package com.itheima_01.test;

public class hh {
    public static void main(String[] args) {
        int[] arr = {1,0,8,5,7,4,3,15,15,0};
        int[] arr1 = new int[arr.length];//[0,0,0,0,0]

        arr1[0] = arr[0];
        int count = 1;
        boolean boo = false;
        for (int i = 1; i < arr.length; i++) {
            for (int j = 0; j < count; j++) {
                if(arr[i] == arr1[j]){
                    boo = false;
                    break;
                }else{
                    boo = true;
                }
            }
            if(boo == true){
                arr1[count] = arr[i];
                count++;
            }
        }
        for (int i = 0; i < arr1.length; i++) {
            System.out.print(arr1[i] + " ");
        }
        System.out.println();
        int arr2[] = new int[count];
        for (int i = 0; i < arr2.length; i++) {
            arr2[i] = arr1[i];
            System.out.print(arr2[i] + " ");
        }

    }
}
